
<h1><span class="yiyi-st" id="yiyi-12">numpy.modf</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.modf.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.modf.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="data">
<dt id="numpy.modf"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">numpy.</code><code class="descname">modf</code><span class="sig-paren">(</span><em>x</em><span class="optional">[</span>, <em>out1</em>, <em>out2</em><span class="optional">]</span><span class="sig-paren">)</span><em class="property"> = &lt;ufunc &apos;modf&apos;&gt;</em></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-14">以元素方式返回数组的小数和整数部分。</span></p>
<p><span class="yiyi-st" id="yiyi-15">如果给定数为负数，分数和整数部分为负。</span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-16">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-17"><strong>x</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-18">输入数组。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-19">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-20"><strong>y1</strong>：ndarray</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-21"><em class="xref py py-obj">x</em>的小数部分。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-22"><strong>y2</strong>：ndarray</span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-23"><em class="xref py py-obj">x</em>的积分部分。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric"><span class="yiyi-st" id="yiyi-24">笔记</span></p>
<p><span class="yiyi-st" id="yiyi-25">对于整数输入，返回值是浮点数。</span></p>
<p class="rubric"><span class="yiyi-st" id="yiyi-26">例子</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">modf</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span> <span class="mf">3.5</span><span class="p">])</span>
<span class="go">(array([ 0. ,  0.5]), array([ 0.,  3.]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">modf</span><span class="p">(</span><span class="o">-</span><span class="mf">0.5</span><span class="p">)</span>
<span class="go">(-0.5, -0)</span>
</pre></div>
</div>
</dd></dl>
